<?php

class Gaatil_model extends CI_Model {

	function find_type($id)
	{
		//ELEMENT
		$query = $this->db->query
		('
    			SELECT type
		 	FROM element
			WHERE id='.$id.'
		');
		$row = $query->row();
		
		if($row->type == "begivenhed" || $row->type == "sted")
		{
			return $row->type;
		}

		if($row->type == "entitet")
		{
			$query2 = $this->db->query
			('
	    			SELECT type_kvant
			 	FROM entitet
				WHERE id='.$id.'
			');
			$row = $query2->row();

			return $row->type_kvant;
		}



	}

}





?>
